# 修改某些业务的协同字段和负责人字段((1)应收款：协同人需要显示 (2)回款单：负责人、协同人需要显示 (3)付款单：负责人、协同人字段需要显示)
# 这个脚本需要刷两次，第一次先刷当天需要测试的公司；第二次需要全局刷  27m
#    需要提前刷的公司直接替换一下corpidList里面的公司。
#    "fullFlag":0， 代表指定特定公司刷；  "fullFlag":1，代表全局刷。
 curl http://127.0.0.1:2019/pro/v1/script/teamMembers/explains/fixTeamMembersField -X POST -H 'Content-type: application/json' -d '{"frontDev": "1","xbbCode": 123456, "fullFlag":0, "corpidList":["1","qwer3"]}'
 curl http://127.0.0.1:2019/pro/v1/script/teamMembers/explains/fixTeamMembersField -X POST -H 'Content-type: application/json' -d '{"frontDev": "1","xbbCode": 123456, "fullFlag":1,  "corpidList":["1","qwer3"]}'

# 增加增量的paas表单数据
# 第一轮脚本测试  364s 6m
# 第二轮脚本测试 279s 5m
curl  http://127.0.0.1:2019/pro/v1/esInit/teamMembersPaasFormDataInit -X POST -H 'Content-type: application/json' -d '{"frontDev":"1","xbbCode":123456,"corpid": "1","byCorpid":0,"userId" : "1","platform":"web","saasMark":2,"businessType":4, "updateTimeStart":1647532800}'

# 增加增量的paas子表单数据
# 第一轮脚本测试  32s 1m
# 第二轮脚本测试 29s 1m
curl  http://127.0.0.1:2019/pro/v1/esInit/paasSubDataInit  -X POST -H 'Content-type: application/json' -d '{"userId":"1","corpid":"1","platform":"web","xbbCode":"123456","saasMark":2,"businessType":2,"byCorpid":0,"businessTypeList":[2],"updateTimeStart":1647532800}'

# 迁移paas表中增加的负责人到paas团队表中作为负责人
# 第一轮脚本测试 359s 6m
# 第二轮脚本测试 102s 2m
curl http://127.0.0.1:2019/pro/v1/script/teamMembers/migratePaasFormDataOwner -X POST -H 'Content-type: application/json' -d '{"xbbCode":"123456", "updateTimeStart":1647532800}'

# 同步paas表的团队信息
# 第一轮脚本测试 188s 3m
# 第二轮脚本测试 76s 1m
curl http://127.0.0.1:2019/pro/v1/esInit/saasDataInit -X POST -H 'Content-type: application/json' -d '{"xbbCode":"123456", "saasMark":1, "businessType":100302, "platform":"web", "corpid": "1","userId"  :  "1","byCorpid": 0, "updateTimeStart":1647532800}'


# 通过别名切换索引
POST /_aliases
{
     "actions": [
         { "remove": { "index": "prd_idx_form_data", "alias": "prd_alias_idx_form_data" }},
         { "add":    { "index": "prd_idx_form_data_v1", "alias": "prd_alias_idx_form_data" }}
     ]
 }

# 以防上线失败，用于回滚表单解释，千万别执行，只有回滚的时候才需要执行
# curl http://127.0.0.1:2019/pro/v1/script/teamMembers/explains/rollBackFixTeamMembersField -X POST -H 'Content-type: application/json' -d '{"frontDev": "1","xbbCode": 123456, "fullFlag":0, "corpidList":["1","qwer3"]}'
# curl http://127.0.0.1:2019/pro/v1/script/teamMembers/explains/rollBackFixTeamMembersField -X POST -H 'Content-type: application/json' -d '{"frontDev": "1","xbbCode": 123456, "fullFlag":1,  "corpidList":["1","qwer3"]}'


